Skip to content

feat(node): default SQLite settings#292

Merged
pratyush618 merged 3 commits into
masterfrom
feat/node-default-sqlite-path
Jun 24, 2026
Merged

feat(node): default SQLite settings#292
pratyush618 merged 3 commits into
masterfrom
feat/node-default-sqlite-path

Conversation

@pratyush618

@pratyush618 pratyush618 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

What

Match the Python SDK's queue-init defaults in the Node SDK.

  • SQLite defaultnew Queue() now opens .taskito/taskito.db (was: required dbPath/dsn). Missing parent dirs are created automatically, like Python's os.makedirs. :memory: skipped.
  • Postgres/Redis — require an explicit dsn, else throw. schema (Postgres, default "taskito") and prefix (Redis) pass through unchanged for per-backend namespacing; both user-overridable.
  • Constructor arg now optional (new Queue()).

Why

Parity with Python (db_path=".taskito/taskito.db", schema="taskito"). Zero-config local start; users override path/schema/prefix later.

Tests

sdks/node/test/core/open.test.ts — default path + dir creation, nested-dir creation, dsn-required for non-sqlite. tsc + biome clean. Pure TS, no native rebuild.

Summary by CodeRabbit

Release Notes

  • New Features
    • Queue can now be instantiated with no arguments, defaulting to SQLite at .taskito/taskito.db
    • SQLite now automatically creates missing parent directories for the database file
  • Bug Fixes
    • Postgres and Redis backends now explicitly error if a DSN is not provided
  • Documentation
    • Backend docs were updated with clearer defaults and state-isolation semantics (SQLite/Postgres/Redis)
  • Tests
    • Added/expanded coverage for default construction and required DSN behavior

Mirror the Python SDK: zero-config SQLite under .taskito/ with auto-created parent dirs; require explicit dsn for postgres/redis.
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b47f5bac-d021-42b1-aac4-a02a0324b3af

📥 Commits

Reviewing files that changed from the base of the PR and between 837174d and 010b2a0.

📒 Files selected for processing (1)
  • sdks/node/test/core/errors.test.ts

📝 Walkthrough

Walkthrough

The Queue constructor now accepts no arguments by defaulting to {}. When using the SQLite backend, the DSN defaults to .taskito/taskito.db and missing parent directories are created via mkdirSync. Postgres and Redis backends now throw a QueueError if no DSN is provided. New tests and README examples reflect these behaviors.

Changes

Queue Default SQLite Configuration

Layer / File(s) Summary
Queue constructor default and toOpenOptions/ensureSqliteParentDir logic
sdks/node/src/queue.ts
Adds mkdirSync/dirname imports, defaults constructor parameter to {}, updates dbPath JSDoc, replaces toOpenOptions logic to default to SQLite at .taskito/taskito.db, calls ensureSqliteParentDir for on-disk paths, and throws QueueError when DSN is absent for postgres/redis backends.
Tests and README documentation
sdks/node/test/core/open.test.ts, sdks/node/test/core/errors.test.ts, sdks/node/README.md
Adds a Vitest suite validating default SQLite construction, nested dbPath parent-directory creation, and DSN-required error for non-SQLite backends; updates errors test to expect postgres-without-dsn to throw; README backends section updated with no-arg Queue example, directory-creation note, and isolation semantics for each backend.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hippity-hop, no args to pass,
SQLite appears out of thin air at last!
.taskito/taskito.db — it's the default call,
mkdirSync digs the burrow, no stumble or fall.
Postgres needs a DSN or the rabbit won't play,
Defaults and dirs — a tidy warren today! 🗂️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(node): default SQLite settings' directly and clearly summarizes the main change: making SQLite settings default in the Node SDK, allowing zero-config initialization with new Queue().
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/node-default-sqlite-path

Comment @coderabbitai help to get the list of available commands.

@pratyush618 pratyush618 changed the title feat(node): default SQLite to .taskito/taskito.db feat(node): default SQLite settings Jun 24, 2026
@pratyush618
pratyush618 merged commit b673ad9 into master Jun 24, 2026
15 checks passed
@pratyush618
pratyush618 deleted the feat/node-default-sqlite-path branch June 27, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant